<script src="__PUBLIC__/js/jquery.datePicker-min.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/ubbeditor/ubbEditor.js" type="text/javascript"></script>
<link href="__PUBLIC__/js/datePicker.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript">
$(document).ready(function(){
	$('.showend_job').datePicker({clickInput:true});
	$("#typeid").change(function(){
		var typeid=$("#typeid").val();

		if(typeid=='12_3001'){
			$("#itype_box").html($("#itype_html").html());
		}else{
			$("#itype_box").html("");
		}
	});

});
</script>
<div class="mulu">
	<a href="__APP__/">Home</a> > <a href="__APP__/Cp/index">Control Panel</a> > 
	<a href="__APP__/Cp/my_art/">Post Articles</a>
</div>
<div class="right-neirong">
    <div class="clear">
    </div>
    <div class="right-messages">
        <div class="right-title">
            <h3 style="margin:0;">Post Articles</h3>
        </div>
        <div class="list">
            <form action="__URL__/add_art" method="post" enctype="multipart/form-data">
            	<if condition="$data['id']"><input type="hidden" name="id" value="{$data['id']}"></if>
            	<fieldset>
				<legend>Basic Elements:</legend>
					<div style="float:left; width:4d69px;">
	            	<p>
	            		<label for="title">Title:</label><input type="text" name="title" id="title" value="{$data['title']}" style="width:300px;">
					</p>
                    <p><label for="reurl">Redirect:</label><input type="text" name="reurl" id="reurl" value="<if condition="$data['id']">{$data['reurl']}<else/>http://</if>" style="width:300px;" /></p>
	            	<p>
	            		<label for="filename">Filename:</label><input type="text" name="filename" id="filename" value="{$data['filename']}" />
					</p>
					<p>
						<label for="picurl">CoverImage:</label><input type="file" name="picurl" id="picurl" value="" style="width:300px;">
	            	</p>
					<p><label for="showend_job">Valid for</label>
						<input type="text" name="showstart" id="showend_job" class="showend_job" style="width:80px;" value="{$data['showstart']|toDate='d/m/Y'}">
						---> <input type="text" name="showend" id="showend_job" class="showend_job" style="width:80px;" value="{$data['showend']|toDate='d/m/Y'}">
					</p>
					<p>
						<label for="cid">Post to</label>
						<select name="cid" id="cid">
							<option value="0">--Favorite City--</option>
							<option value="0" {:selected(0,$data['cid'])}>All</option>
							<volist name="citylist" id="v">
								<option value="{$v['id']}"{$v['id']|selected=$data['cid']}>{$v['ctitle']}</option>
							</volist>
						</select>
					</p>
					<p>
						<label for="flag">Attribute</label>
						<volist name="flag" id="v">
							<input type="checkbox" value="{$v['att']}" name="flag[]"{$v['att']|string2checked=$data['flag']}>{$v['attname']}   
						</volist>
					</p>
					<p>
						<label for="keywords">Tags:</label>
						<input type="text" name="keywords" id="keywords" value="{$data['keywords']}" class="w320"><br>
                        Please separate tags with ",".
					</p>
                    <p>
                    	<label for="industry">Vol:</label>
						<input type="text" name="industry" value="{$data['industry']}" id="industry" /> Magazines vol ex. vol1 vol2
                    </p>
					</div>
					
					<div style="width:200px; float:left;">
					<if condition="$data['picurl']">
						<img src="{$data['picurl']}" id="picurl_img" width="120">	
					</if>
					</div>
				</fieldset>
				<fieldset>
				<legend>Select Section:</legend>
					<p>
						<label for="typeid">Section:</label>
						<select id="typeid" name="typeid">
							<option>---Select Main Category---</option>
							<volist name="class_tree" id="v">
								<if condition="$v['ispart'] eq 1">
									<optgroup label="{$v['typename']}">
										<volist name="v['_son']" id="vs">
											<option value="{$v['channeltype']}_{$vs['id']}"{$vs['id']|selected=$data['typeid']}>{$vs['typename']}</option>
										</volist>
									</optgroup>
								<else/>
									<option value="{$v['channeltype']}_{$v['id']}"{$v['id']|selected=$data['typeid']}>{$v['typename']}</option>
								</if>
														
							</volist>
						</select>
					</p>
                    <p id="itype_box">
                    <php>
$itype=array('spot','walk','talk','vision');
if($data['typeid']=='3001'){
</php>
                    	<label for="typeid">Type:</label>

						<select id="itype" name="itype">
							<option>---Select Type---</option>
                            <volist name="itype" id="t">
                                <option value="{$t}"{$t|selected=$data['itype']}>{$t}</option>
                            </volist>
						</select>
<php>
}
</php>
                    </p>
					<!--p>
						<label for="typeid2">Second<br>Category:</label>
						<select id="typeid2" name="typeid2[]" size="5" multiple="multiple" >
							<option>---Select Second Category---</option>
							<volist name="class_tree" id="v">
								<if condition="$v['ispart'] eq 1">
									<optgroup label="{$v['typename']}">
										<volist name="v['_son']" id="vs">
											<option value="{$vs['id']}" {$vs['id']|string2checked=$data['typeid2'],',','selected'}>{$vs['typename']}</option>
										</volist>
									</optgroup>
								<else/>
									<option value="{$v['id']}"{$v['id']|string2checked=$data['typeid2'],',','selected'}>{$v['typename']}</option>
								</if>
														
							</volist>
						</select>
					</p-->
				</fieldset>
				</div>
				<fieldset>
					<legend>Articles info:</legend>
					<p><label for="my_content">Summary:</label>
						<textarea cols="50" rows="5" name="my_content" id="my_content">{$data['my_content']|br2nl}</textarea>
					</p>
					<p><label for="content" style="float:left;">Content:</label>
					<!-- 编辑器调用开始 -->
					<script type="text/javascript" src="__ROOT__/Public/js/FCKeditor/fckeditor.js"></script>
					<textarea id="editor_editor" name="content">{$data['content']['content']}</textarea>
					<script type="text/javascript">
					var oFCKeditor = new FCKeditor( "editor_editor","100%","445px" );
					oFCKeditor.BasePath = "__ROOT__/Public/js/FCKeditor/" ; oFCKeditor.ReplaceTextarea();
					function resetEditor(){
						setContents("editor_editor",document.getElementById("editor_editor").value)
					};
					function saveEditor(){
						document.getElementById("editor_editor").value = getContents("editor_editor");
					}
					function InsertHTML(html){
						var oEditor = FCKeditorAPI.GetInstance("editor_editor");
						if (oEditor.EditMode == FCK_EDITMODE_WYSIWYG ){
							oEditor.InsertHtml(html);
							}else
								alert( "WYSIWYG Model" );
					}</script>
					<!-- 编辑器调用结束 -->
					</p>
				</fieldset>
				<p>
					<input type="submit" value="Submit">            
					<input type="reset" value="Reset">            
				</p>
            </form>
            <div><p style="font-size:14px;">
    	Attribute <strong>s</strong>:Scroll <strong>h</strong>:Headline  <strong>l</strong>:Slide  <strong>r</strong>:Recommend  <strong>p</strong>:Picture  <strong>j</strong>:Jump  <strong>f</strong>:Feature  <strong>b</strong>:Bold
    </p>
    <p>
    	首页幻灯 <strong>l</strong>:Slide 图片506*190<br />
        首页推荐 <strong>f</strong>:Feature<br />
		电子杂志频道首页幻灯 <strong>h</strong>:Headline 图片550*376<br />
		电子杂志频道首页 Featured部分 小图 <strong>p</strong>:Picture 图片 132*90<br />
		电子杂志频道首页 四个专题部分 小图 <strong>p</strong>:Picture 图片 132*90<br />
        电子杂志频道首页 四个专题部分 文字 <strong>f</strong>:Feature + Select Section的type
    </p>
    </div>
    </div>
</div>
<div id="itype_html" style="display:none;">
                    	<label for="typeid">Type:</label>
<php>
$itype=array('spot','walk','talk','vision');
</php>
						<select id="itype" name="itype">
							<option>---Select Type---</option>
                            <volist name="itype" id="t">
                                <option value="{$t}"{$t|selected=$data['itype']}>{$t}</option>
                            </volist>
						</select>
</div>

<div class="clear"></div>


